package Thread.BlockingQueue;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

public class Demo32 {
    public static void main(String[] args) throws InterruptedException {
        //无论是put还是take操作都会发生阻塞现象
        BlockingQueue<String> queue=new ArrayBlockingQueue<>(3);
        queue.put("abc");
        System.out.println("put成功");
        queue.put("abc");
        System.out.println("put成功");
//        queue.put("abc");
//        System.out.println("put成功");
//        queue.put("abc");
//        System.out.println("put成功");
        queue.take();
        System.out.println("take成功");
        queue.take();
        System.out.println("take成功");
        queue.take();
        System.out.println("take成功");

    }

}
